package com.yanqu.road.entity.player;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.math.BigInteger;
import java.util.Objects;

@FieldTypeAnnotation(tableName = "t_u_invite_user_data")
public class ShareInvitationData extends DataObject {
    @FieldTypeAnnotation(select = true,update = true)
    private long userId;
    @FieldTypeAnnotation(update = true)
    private long invitationServerId;
    @FieldTypeAnnotation(update = true)
    private long invitationUserId; // 其实是aliasId，不是userId
    @FieldTypeAnnotation
    private BigInteger earnSpeed;
    @FieldTypeAnnotation
    private long vip;
    @FieldTypeAnnotation
    private long registerTime;
    @FieldTypeAnnotation
    private String openId = "";

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if (!Objects.equals(this.userId, userId)) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public long getInvitationServerId() {
        return invitationServerId;
    }

    public void setInvitationServerId(long invitationServerId) {
        if (!Objects.equals(this.invitationServerId, invitationServerId)) {
            this.invitationServerId = invitationServerId;
            setUpdateOption();
        }
    }

    public long getInvitationUserId() {
        return invitationUserId;
    }

    public void setInvitationUserId(long invitationUserId) {
        if (!Objects.equals(this.invitationUserId, invitationUserId)) {
            this.invitationUserId = invitationUserId;
            setUpdateOption();
        }
    }

    public BigInteger getEarnSpeed() {
        return earnSpeed;
    }

    public void setEarnSpeed(BigInteger earnSpeed) {
        if (!Objects.equals(this.earnSpeed, earnSpeed)) {
            this.earnSpeed = earnSpeed;
            setUpdateOption();
        }
    }

    public long getVip() {
        return vip;
    }

    public void setVip(long vip) {
        if (!Objects.equals(this.vip, vip)) {
            this.vip = vip;
            setUpdateOption();
        }
    }

    public long getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(long registerTime) {
        this.registerTime = registerTime;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        if (openId == null) {
            return;
        }
        if (!Objects.equals(this.openId, openId)) {
            this.openId = openId;
            setUpdateOption();
        }
    }
}
